\(\int (3+3 \sin (e+f x)) (c+d \sin (e+f x)) \, dx\) [428]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 45 \[ \int (3+3 \sin (e+f x)) (c+d \sin (e+f x)) \, dx=\frac {3}{2} (2 c+d) x-\frac {3 (c+d) \cos (e+f x)}{f}-\frac {3 d \cos (e+f x) \sin (e+f x)}{2 f} \]

[Out]

1/2*a*(2*c+d)*x-a*(c+d)*cos(f*x+e)/f-1/2*a*d*cos(f*x+e)*sin(f*x+e)/f

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.07, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {2813} \[ \int (3+3 \sin (e+f x)) (c+d \sin (e+f x)) \, dx=-\frac {a (c+d) \cos (e+f x)}{f}+\frac {1}{2} a x (2 c+d)-\frac {a d \sin (e+f x) \cos (e+f x)}{2 f} \]

[In]

Int[(a + a*Sin[e + f*x])*(c + d*Sin[e + f*x]),x]

[Out]

(a*(2*c + d)*x)/2 - (a*(c + d)*Cos[e + f*x])/f - (a*d*Cos[e + f*x]*Sin[e + f*x])/(2*f)

Rule 2813

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(2*a*c +
 b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Cos[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} a (2 c+d) x-\frac {a (c+d) \cos (e+f x)}{f}-\frac {a d \cos (e+f x) \sin (e+f x)}{2 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.16 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.98 \[ \int (3+3 \sin (e+f x)) (c+d \sin (e+f x)) \, dx=-\frac {3 (-2 (d e+2 c f x+d f x)+4 (c+d) \cos (e+f x)+d \sin (2 (e+f x)))}{4 f} \]

[In]

Integrate[(3 + 3*Sin[e + f*x])*(c + d*Sin[e + f*x]),x]

[Out]

(-3*(-2*(d*e + 2*c*f*x + d*f*x) + 4*(c + d)*Cos[e + f*x] + d*Sin[2*(e + f*x)]))/(4*f)

Maple [A] (verified)

Time = 0.54 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.98

method result size
parallelrisch \(\frac {\left (-\frac {d \sin \left (2 f x +2 e \right )}{4}+\left (-c -d \right ) \cos \left (f x +e \right )+f x c +\frac {d x f}{2}+c +d \right ) a}{f}\) \(44\)
parts \(a c x -\frac {\left (a c +d a \right ) \cos \left (f x +e \right )}{f}+\frac {d a \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) \(52\)
risch \(a c x +\frac {a x d}{2}-\frac {a \cos \left (f x +e \right ) c}{f}-\frac {a \cos \left (f x +e \right ) d}{f}-\frac {d a \sin \left (2 f x +2 e \right )}{4 f}\) \(53\)
derivativedivides \(\frac {d a \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-a c \cos \left (f x +e \right )-d a \cos \left (f x +e \right )+a c \left (f x +e \right )}{f}\) \(59\)
default \(\frac {d a \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-a c \cos \left (f x +e \right )-d a \cos \left (f x +e \right )+a c \left (f x +e \right )}{f}\) \(59\)
norman \(\frac {\left (a c +\frac {1}{2} d a \right ) x +\left (a c +\frac {1}{2} d a \right ) x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (2 a c +d a \right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\frac {\left (2 a c +2 d a \right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {d a \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {2 \left (a c +d a \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {d a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}\) \(150\)

[In]

int((a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

(-1/4*d*sin(2*f*x+2*e)+(-c-d)*cos(f*x+e)+f*x*c+1/2*d*x*f+c+d)*a/f

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.07 \[ \int (3+3 \sin (e+f x)) (c+d \sin (e+f x)) \, dx=-\frac {a d \cos \left (f x + e\right ) \sin \left (f x + e\right ) - {\left (2 \, a c + a d\right )} f x + 2 \, {\left (a c + a d\right )} \cos \left (f x + e\right )}{2 \, f} \]

[In]

integrate((a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x, algorithm="fricas")

[Out]

-1/2*(a*d*cos(f*x + e)*sin(f*x + e) - (2*a*c + a*d)*f*x + 2*(a*c + a*d)*cos(f*x + e))/f

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 94 vs. \(2 (42) = 84\).

Time = 0.10 (sec) , antiderivative size = 94, normalized size of antiderivative = 2.09 \[ \int (3+3 \sin (e+f x)) (c+d \sin (e+f x)) \, dx=\begin {cases} a c x - \frac {a c \cos {\left (e + f x \right )}}{f} + \frac {a d x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a d x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {a d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {a d \cos {\left (e + f x \right )}}{f} & \text {for}\: f \neq 0 \\x \left (c + d \sin {\left (e \right )}\right ) \left (a \sin {\left (e \right )} + a\right ) & \text {otherwise} \end {cases} \]

[In]

integrate((a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x)

[Out]

Piecewise((a*c*x - a*c*cos(e + f*x)/f + a*d*x*sin(e + f*x)**2/2 + a*d*x*cos(e + f*x)**2/2 - a*d*sin(e + f*x)*c
os(e + f*x)/(2*f) - a*d*cos(e + f*x)/f, Ne(f, 0)), (x*(c + d*sin(e))*(a*sin(e) + a), True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.27 \[ \int (3+3 \sin (e+f x)) (c+d \sin (e+f x)) \, dx=\frac {4 \, {\left (f x + e\right )} a c + {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a d - 4 \, a c \cos \left (f x + e\right ) - 4 \, a d \cos \left (f x + e\right )}{4 \, f} \]

[In]

integrate((a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x, algorithm="maxima")

[Out]

1/4*(4*(f*x + e)*a*c + (2*f*x + 2*e - sin(2*f*x + 2*e))*a*d - 4*a*c*cos(f*x + e) - 4*a*d*cos(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.47 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.16 \[ \int (3+3 \sin (e+f x)) (c+d \sin (e+f x)) \, dx=a c x + \frac {1}{2} \, a d x - \frac {a c \cos \left (f x + e\right )}{f} - \frac {a d \cos \left (f x + e\right )}{f} - \frac {a d \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \]

[In]

integrate((a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x, algorithm="giac")

[Out]

a*c*x + 1/2*a*d*x - a*c*cos(f*x + e)/f - a*d*cos(f*x + e)/f - 1/4*a*d*sin(2*f*x + 2*e)/f

Mupad [B] (verification not implemented)

Time = 7.10 (sec) , antiderivative size = 100, normalized size of antiderivative = 2.22 \[ \int (3+3 \sin (e+f x)) (c+d \sin (e+f x)) \, dx=a\,c\,x+\frac {a\,d\,x}{2}-\frac {-a\,d\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\left (2\,a\,c+2\,a\,d\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+a\,d\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+2\,a\,c+2\,a\,d}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )} \]

[In]

int((a + a*sin(e + f*x))*(c + d*sin(e + f*x)),x)

[Out]

a*c*x + (a*d*x)/2 - (2*a*c + 2*a*d + tan(e/2 + (f*x)/2)^2*(2*a*c + 2*a*d) - a*d*tan(e/2 + (f*x)/2)^3 + a*d*tan
(e/2 + (f*x)/2))/(f*(2*tan(e/2 + (f*x)/2)^2 + tan(e/2 + (f*x)/2)^4 + 1))